/********************************************
 *      堆串
 * Created by zlj on 2024/6/28.
********************************************/

#ifndef DATA_STRUCTURE_HSTRING_H
#define DATA_STRUCTURE_HSTRING_H

#include "option_config.h"

typedef struct HString
{
    char *ch;         /*指向字符串所在空间首地址*/
    int length;       /*记录字符串长度*/
} HString;


void InitHString(HString *s);

void PrintHString(HString *s);

void HStrAssign(HString *s, char *str);

void HStrCopy(HString *s, HString *t);

bool HStrEmpty(HString *s);

int HStrCompare(HString *s, HString *t);

int HStrLength(HString *s);

void HStrConcat(HString *t, HString *s1, HString *s2);

void HStrSubString(HString *s, HString *sub, int pos, int len);

void HStrInsert(HString *s, int pos, HString *t);

void HStrDelete(HString *s, int pos, int len);

void HStrClear(HString *s);

int HStrIndex(HString *s, HString *t, int pos);

void HStrReplace(HString *s, HString *t, HString *v);

#endif //DATA_STRUCTURE_HSTRING_H
